<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>改变网页背景颜色<strong></strong></title>
	</head>
	<body>
		<h2>改变网页背景颜色</h2>
		<p>请输入一个颜色值：</p>
		<input id="a1" type="text">
		<button onclick="color()">提交</button>
		<script>
			function color() {
				var a1 = document.getElementById("a1").value;
				document.body.style.backgroundColor = a1;
			}
		</script>
	</body>
</html>